package com.beans.usercontoller;

import com.beans.userservice.UserService;
import com.model.User;
import org.springframework.stereotype.Controller;

import javax.annotation.Resource;


@Controller
public class UserController5 {
    private UserService userService;

    @Resource
    public void setUserService(UserService userService) {
        this.userService = userService;
    }

    public void sayHi(String name){
        System.out.println("Hi "+name);
    }
    public User getUserId(Integer id){
        //伪代码
        return userService.getUserById(id);
    }
}
